<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>Document</title>
  </head>
  <body>
    <script type="text/javascript">
      class Person {
        constructor(name, age) {
          this.name = name;
          this.age = age;
        }
        speak() {
          console.log(`${this.name}说话了`);
        }
      }
      const p1 = new Person("tom", 18);
      console.log(p1);

      class Student extends Person {
        constructor(name, age, grade) {
          super(name, age);
          this.grade = grade;
        }
      }
      const st1 = new Student("jack", 18, "3");
      console.log(st1);
    </script>
  </body>
</html>
